package tr.edu.yildiz.ce.dap.acm.service;

import java.io.IOException;
import java.io.PrintWriter;

import tr.edu.yildiz.ce.dap.acm.gen.Cache;
import tr.edu.yildiz.ce.dap.acm.gen.CachedComponent;
import tr.edu.yildiz.ce.dap.acm.util.exception.AlreadyCachedException;
import tr.edu.yildiz.ce.dap.acm.util.exception.CacheCanNotBeFoundException;
import tr.edu.yildiz.ce.dap.acm.util.exception.CacheConfigurationFaultException;
import tr.edu.yildiz.ce.dap.acm.util.exception.CanNotGenerateIDException;
import tr.edu.yildiz.ce.dap.appagent.exception.AgentDeploymentException;
import tr.edu.yildiz.ce.dap.appagent.model.Component;

public interface CacheManagerService {
	
	void addComponent(Component component) throws AgentDeploymentException,AlreadyCachedException,CacheConfigurationFaultException,CanNotGenerateIDException;
	
	void removeComponent(Component component) throws CacheCanNotBeFoundException,CacheConfigurationFaultException,CanNotGenerateIDException;
	
	String getUrl(Component component) throws CacheCanNotBeFoundException,CacheConfigurationFaultException,CanNotGenerateIDException;
	
	void resetCache() throws CacheConfigurationFaultException;
	
	public Cache getCache() throws CacheConfigurationFaultException;
	
	String generateUrl(Component component) throws CacheConfigurationFaultException,CanNotGenerateIDException;
	
	public String generateId(Component component) throws CanNotGenerateIDException;
	
	public void writeCachedComponent(PrintWriter pw, CachedComponent cComponent) throws IOException;
	
}
